package fr.ece.ing4.si.singlethread;

import fr.ece.ing4.si.core.*;

public class SingleThreadMonteCarlo extends AbstractMonteCarlo {
    
    @Override
    public Object doInBackground() {
        
        return null;
    }
    
    @Override
    public double computeOptionPrice(MonteCarloArgs MCArgs) {
        double sum = 0;
        for (int i=0 ; i<MCArgs.nSimulations ; i++) {
            sum += MonteCarloStandardOptionOneSimulation(
                    MCArgs.flag, 
                    MCArgs.S, 
                    MCArgs.X, 
                    MCArgs.T, 
                    MCArgs.r, 
                    MCArgs.b, 
                    MCArgs.v,
                    MCArgs.nSteps);
        }
        
        double average = sum / (double)MCArgs.nSimulations;
        
        return average;
    }
}
